// Copyright (c) 2020-present,  INSPUR Co, Ltd.  All rights reserved.
// This source code is licensed under Apache 2.0 License.

#include "memory_arena_index.h"
#include "pure_mem/memoryblock/memory_arena/memory_arena.h"

//class MemArenaIndex;
namespace rocksdb{

class MemArenaARTIndex : public MemArenaIndex {
public:
    explicit MemArenaARTIndex(const InternalKeyComparator& mkeyCmp);
    ~MemArenaARTIndex();

    bool Insert(const Slice& startKey, IMemoryArena* memoryArena) override;
    IMemoryArena* SeekForMemoryArena(const Slice& key) override;
    void ClearMemoryArena();

private:
    MemArena::KeyComparator mkey_cmp_;
    InlineUserKeyIndex<const MemTableRep::KeyComparator &> art_list_{mkey_cmp_, ART_ROWEX};
};
}  //namespace rockdb